<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link
	href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css"
	rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript"
	src="http://code.google.com/apis/gears/gears_init.js"></script>
<script type="text/javascript">

function initialize() 
{	
  // Try W3C Geolocation method (Preferred)
  if(navigator.geolocation) 
  {
    navigator.geolocation.getCurrentPosition(
        function(position) {
            location.href="hello_controller/get_lucky_hello?lat="+position.coords.latitude+"&longi="+position.coords.longitude;});
  } 
  else if (google.gears) 
  {
    // Try Google Gears Geolocation
    var geo = google.gears.factory.create('beta.geolocation');
    
    geo.getCurrentPosition( 
        function(position) {
  		    location.href="hello_controller/get_lucky_hello?lat="+position.coords.latitude+"&longi="+position.coords.longitude;});
	
  }
}
</script>
</head>
<body onload="initialize()">
	<div id="map_canvas"></div>
</body>
</html>
